using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Management.Core.Models.Mapping
{
    public class NewsMap : EntityTypeConfiguration<News>
    {
        public NewsMap()
        {
            // Primary Key
            this.HasKey(t => t.NewsID);

            // Properties
            // Table & Column Mappings
            this.ToTable("News");
            this.Property(t => t.NewsID).HasColumnName("NewsID");
            this.Property(t => t.Author).HasColumnName("Author");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Content).HasColumnName("Content");
            this.Property(t => t.ContentType).HasColumnName("ContentType");
            this.Property(t => t.Created_at).HasColumnName("Created_at");
            this.Property(t => t.Updated_at).HasColumnName("Updated_at");
        }
    }
}
